// index.js
// 获取应用实例
const API = require("../../http/API")
const http = require("../../http/http")
Page({
  data: {
    banner:[],
		for:["免费教程","专业课程","大触直播","教程兑换","学员成长","每日一画","素材下载","社区回答"],
		dachu:[],
		remen:[],
		wenda:[],
		sucai:[]
  },
  onLoad() {
    http(API.banner).then(res=>{
        this.setData({
            banner:res.data.data
        })
    })
    http(API.new).then(res=>{
        this.setData({
					remen:res.data
				})
    })
    http(API.news).then(res=>{
        this.setData({
					sucai:res.data.data
				})
    })
    http(API.heat).then(res=>{
        this.setData({
					wenda:res.data
				})
    })
    http(API.daniu).then(res=>{
        this.setData({
					dachu:res.data
				})
    })
	},
	clickxq(e){
		wx.navigateTo({
			url: '/pages/xiangqing/xiangqing?id='+e.currentTarget.id,
		})
	},
	todachu(){
		wx.redirectTo({
			url: '/pages/touch/touch',
		})
	},
	tojiaocheng(){
		wx.redirectTo({
			url: '/pages/course/course',
		})
	}
})
